﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_Admin_AdminPWDUpdate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["adminCack"];
        if (cookie != null)
        {
            string username = cookie["Username"];
     
            string pwd1 = AdminPWD1.Text.ToString().Trim();
            string pwd2 = AdminPWD2.Text.ToString().Trim();
            if (pwd1 == "" || pwd2 == "")
            {
                DB.Alert("输入不能为空");
            }
            if (pwd1 == pwd2)
            {
                Admin upadminPWD = new Admin();
                upadminPWD.UpdateAdminPWD(username, DB.Encrypt(pwd1));
                DB.Msg("密码修改成功~！");
            }
            else
            {
                DB.Alert("密码前后不一致~！");
            }
        }
        else
        {
            Response.Redirect("~/admin/Admin_Login.aspx");
        }

        
    }
}
